package quizSuggestion

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method 'PUT'
        url value(consumer(regex('/api/v2/suggestions/\\d+')),
                producer('/api/v2/suggestions/1'))
        headers {
            contentType(applicationJsonUtf8())
            header('id', 1)
        }
        body("""
            {
                "id": 1,
                "content": "content",
            }
        """)
        bodyMatchers {
            jsonPath('$.id', byRegex(number()))
            jsonPath('$.content', byRegex(nonEmpty()))

        }
    }
    response {
        status 204
    }
}